May be processors won't make much of the difference here as i7-7700HQ(Base - 2.8GHz, Turbo - 3.8GHz) has negligible amount of more clock speed than the i7-6700HQ(Base - 2.6GHz, Turbo - 3.5GHz) but the 4GB Nvidia 1050 graphics over 960M 2GB can significantly effect the overall performance of laptop.
Actually, it is not about which GPU they both come with, it is about the amount of VRAM they have. From benchmarks you won't notice much difference in performance of Nvidia GeForce GTX 960M and 1050 but when it comes to 2GB 960M vs 4GB 1050, I don't think we need to spend more time in identifying the winner here.
Coming back to processor,
As I said earlier that there is not much difference in performance of both CPUs but as you'll be using your laptop most of the time for PS and LR, processor has again became a very important choice to make.
As said by Desolate Mirror earlier in this thread that SSD, RAM and CPU are the most important things to check while buying laptop for photo editing, so agreeing with that -
1TB SSD on a laptop is very good (you can cut on rates by buying the laptop with 512GB and using an external hard drive but that's up to you),
24GB of RAM is again very good (You should be fine with even 16GB but having more amount of RAM is always beneficial)
Processor - i7-7700HQ vs i7-6700HQ
The newer generation processor will come with its own perks but they won't be game changing. Most of the times, newer generation processor are better in terms of handling multitasking, battery efficiency and thermal management. If you want to know how much better particularly the newer generation i7 is, then here's the 3D Mark, X264 and Cinebench benchmark comparison of both i7 laptop processor models. You can decide there by analysing the real life performance scores of both the i7 models.
Overall, I think the newer Dell XPS laptop (with 7th gen i7 and GTX 1050) would be better for Photoshop/Lightroom and also in terms of overall performance. You can also get the older Dell XPS, if you're running tight on budget. That would be also a great choice for PS and LR but if you can flex your budget then go for the newer Kaby Lake Dell XPS, it would be a much better choice.